// 
// Copyright 2010 Classpath Pty Ltd <opensource@classpath.com.au>
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// 

using build

**
** Tests the `GenericAdapter` class.
**
internal class GenericAdapterTest : Test {

    **
    ** Stores an instance of `GenericAdapter` for testing.
    **
    GenericAdapter? adapter

    **
    ** Stores an instance of `CanUseColumnType` for testing.
    **
    CanUseColumnType? canUseColumnType

    **
    ** Stores an instance of `CanUseColumnOptions` for testing.
    **
    CanUseColumnOptions? canUseColumnOptions

    **
    ** Stores an instance of `CanCreateColumn` for testing.
    **
    CanCreateColumn? canCreateColumn

    **
    ** Stores an instance of `CanDropColumn` for testing.
    **
    CanDropColumn? canDropColumn

    **
    ** Stores an instance of `CanUseTableOptions` for testing.
    **
    CanUseTableOptions? canUseTableOptions

    **
    ** Stores an instance of `CanDropTableOptions` for testing.
    **
    CanDropTableOptions? canDropTableOptions

    **
    ** Performs additional setup needed for GenericAdapterTest
    **
    override Void setup() {
        super.setup()
        adapter = GenericAdapter()
        canUseColumnType = CanUseColumnTypeTestClass()
        canUseColumnOptions = CanUseColumnOptionsTestClass()
        canCreateColumn = CanCreateColumnTestClass()
        canDropColumn = CanDropColumnTestClass()
        canUseTableOptions = CanUseTableOptionsTestClass()
        canDropTableOptions = CanDropTableOptionsTestClass()
    }

    **
    ** Cleans up additional setup needed for GenericAdapterTest
    **
    override Void teardown() {
        super.teardown()
        adapter = null
        canUseColumnType = null
        canUseColumnOptions = null
        canCreateColumn = null
        canDropColumn = null
        canUseTableOptions = null
        canDropTableOptions = null
    }

    **
    ** Tests `GenericAdapter.createTableSql`
    **
    Void testCreateTableSqlWithEmptyTable() {
        table := CreatedTable("table_name")
        expected := "CREATE TABLE table_name"
        verifyEq(expected, adapter.createTableSql(table))
    }

    **
    ** Tests `GenericAdapter.creatTableSql`
    **
    Void testCreateTableWithSimpleColumns() {
        table := CreatedTable("table_name") {
            createColumn("column_name_1", integer)
            createColumn("column_name_2", varchar(32))
            createColumn("column_name_3", float(1234, 5678))
        }
        expected := """CREATE TABLE table_name (
                       column_name_1 INTEGER,
                       column_name_2 VARCHAR(32),
                       column_name_3 FLOAT(1234, 5678)
                       )"""
        verifyEq(expected, adapter.createTableSql(table))
    }

    **
    ** Tests `GenericAdapter.creatTableSql`
    **
    Void testCreateTableWithColumnOptions() {
        table := CreatedTable("table_name") {
            createColumn("column_name_1", integer) { autoIncrement; primaryKey }
            createColumn("column_name_2", varchar(32)) { notNull; references("referenced_table_name", "referenced_column_name"); unique }
            createColumn("column_name_3", float(1234, 5678)) { check("check_rule"); comment("comment"); defaultValue("123.45") }
        }
        expected := """CREATE TABLE table_name (
                       column_name_1 INTEGER AUTO_INCREMENT PRIMARY KEY,
                       column_name_2 VARCHAR(32) NOT NULL REFERENCES referenced_table_name (referenced_column_name) UNIQUE,
                       column_name_3 FLOAT(1234, 5678) CHECK (check_rule) COMMENT 'comment' DEFAULT 123.45
                       )"""
        verifyEq(expected, adapter.createTableSql(table))
    }

    **
    ** Tests `GenericAdapter.creatTableSql`
    **
    Void testCreateTableWithColumnOptionsAndTableOptions() {
        table := CreatedTable("table_name") {
            createColumn("column_name_1", integer) { autoIncrement; primaryKey }
            createColumn("column_name_2", varchar(32)) { notNull; references("referenced_table_name", "referenced_column_name"); unique }
            createColumn("column_name_3", float(1234, 5678)) { check("check_rule"); comment("comment"); defaultValue("123.45") }
            check("ck_name", "column_name_3 > 0.0")
            index("idx_column_name_3", ["column_name_3"])
            unique("uq_column_name_2", ["column_name_2"])
        }
        expected := """CREATE TABLE table_name (
                       column_name_1 INTEGER AUTO_INCREMENT PRIMARY KEY,
                       column_name_2 VARCHAR(32) NOT NULL REFERENCES referenced_table_name (referenced_column_name) UNIQUE,
                       column_name_3 FLOAT(1234, 5678) CHECK (check_rule) COMMENT 'comment' DEFAULT 123.45,
                       CONSTRAINT ck_name CHECK (column_name_3 > 0.0),
                       INDEX idx_column_name_3 (column_name_3),
                       CONSTRAINT uq_column_name_2 UNIQUE (column_name_2)
                       )"""
        verifyEq(expected, adapter.createTableSql(table))
    }

    **
    ** Tests `GenericAdapter.alterTableSql`
    **
    Void testAlterTableWithEmptyTable() {
        table := AlteredTable("table_name")
        expected := "ALTER TABLE table_name"
        verifyEq(expected, adapter.alterTableSql(table))
    }

    **
    ** Tests `GenericAdapter.alterTableSql`
    **
    Void testAlterTableWithCreatedColumns() {
        table := AlteredTable("table_name") {
            createColumn("column_name_1", integer)
            createColumn("column_name_2", varchar(32))
        }
        expected := """ALTER TABLE table_name
                       ADD COLUMN column_name_1 INTEGER,
                       ADD COLUMN column_name_2 VARCHAR(32)"""
        verifyEq(expected, adapter.alterTableSql(table))
    }

    **
    ** Tests `GenericAdapter.alterTableSql`
    **
    Void testAlterTableWithDroppedColumns() {
        table := AlteredTable("table_name") {
            dropColumn("column_name_1")
            dropColumn("column_name_2")
        }
        expected := """ALTER TABLE table_name
                       DROP COLUMN column_name_1,
                       DROP COLUMN column_name_2"""
        verifyEq(expected, adapter.alterTableSql(table))
    }

    **
    ** Tests `GenericAdapter.alterTableSql`
    **
    Void testAlterTableWithCreatedAndDroppedColumns() {
        table := AlteredTable("table_name") {
            createColumn("column_name_1", integer)
            createColumn("column_name_2", varchar(32))
            dropColumn("column_name_1")
            dropColumn("column_name_2")
        }
        expected := """ALTER TABLE table_name
                       ADD COLUMN column_name_1 INTEGER,
                       ADD COLUMN column_name_2 VARCHAR(32),
                       DROP COLUMN column_name_1,
                       DROP COLUMN column_name_2"""
        verifyEq(expected, adapter.alterTableSql(table))
    }

    **
    ** Tests `GenericAdapter.alterTableSql`
    **
    Void testAlterTableWithTableOptions() {
        table := AlteredTable("table_name") {
            check("ck_name", "column_name_3 > 0.0")
            index("idx_column_name_3", ["column_name_3"])
            unique("uq_column_name_2", ["column_name_2"])
        }
        expected := """ALTER TABLE table_name
                       ADD CONSTRAINT ck_name CHECK (column_name_3 > 0.0),
                       ADD INDEX idx_column_name_3 (column_name_3),
                       ADD CONSTRAINT uq_column_name_2 UNIQUE (column_name_2)"""
        verifyEq(expected, adapter.alterTableSql(table))
    }

    **
    ** Tests `GenericAdapter.alterTableSql`
    **
    Void testAlterTableWithDroppedTableOptions() {
        table := AlteredTable("table_name") {
            dropForeignKey("fk_name")
            dropIndex("idx_name")
            dropPrimaryKey("pk_name")
        }
        expected := """ALTER TABLE table_name
                       DROP FOREIGN KEY fk_name,
                       DROP INDEX idx_name,
                       DROP PRIMARY KEY pk_name"""
        verifyEq(expected, adapter.alterTableSql(table))
    }

    **
    ** Tests `GenericAdapter.alterTableSql`
    **
    Void testAlterTableWithCreatedAndDroppedColumnsAndTableOptions() {
        table := AlteredTable("table_name") {
            createColumn("column_name_1", integer)
            createColumn("column_name_2", varchar(32))
            dropColumn("column_name_1")
            dropColumn("column_name_2")
            check("ck_name", "column_name_3 > 0.0")
            index("idx_column_name_3", ["column_name_3"])
            unique("uq_column_name_2", ["column_name_2"])
        }
        expected := """ALTER TABLE table_name
                       ADD COLUMN column_name_1 INTEGER,
                       ADD COLUMN column_name_2 VARCHAR(32),
                       DROP COLUMN column_name_1,
                       DROP COLUMN column_name_2,
                       ADD CONSTRAINT ck_name CHECK (column_name_3 > 0.0),
                       ADD INDEX idx_column_name_3 (column_name_3),
                       ADD CONSTRAINT uq_column_name_2 UNIQUE (column_name_2)"""
        verifyEq(expected, adapter.alterTableSql(table))
    }

    **
    ** Tests `GenericAdapter.tableOptionSql`
    **
    Void testTableOptionSql() {
        verifyEq("CONSTRAINT ck_name CHECK (check_rule)", adapter.tableOptionSql(canUseTableOptions.check("ck_name", "check_rule")))
        verifyEq("CONSTRAINT fk_name FOREIGN KEY (column_name_1, column_name_2) REFERENCES referenced_table_name (referenced_column_name_1, referenced_column_name_2)", adapter.tableOptionSql(canUseTableOptions.foreignKey("fk_name", ["column_name_1", "column_name_2"], canUseTableOptions.references("referenced_table_name", ["referenced_column_name_1", "referenced_column_name_2"]))))
        verifyEq("INDEX idx_name (column_name_1, column_name_2)", adapter.tableOptionSql(canUseTableOptions.index("idx_name", ["column_name_1", "column_name_2"])))
        verifyEq("CONSTRAINT pk_name PRIMARY KEY (column_name_1, column_name_2)", adapter.tableOptionSql(canUseTableOptions.primaryKey("pk_name", ["column_name_1", "column_name_2"])))
        verifyEq("CONSTRAINT uq_name UNIQUE (column_name_1, column_name_2)", adapter.tableOptionSql(canUseTableOptions.unique("uq_name", ["column_name_1", "column_name_2"])))
        verifyEq("ADD CONSTRAINT ck_name CHECK (check_rule)", adapter.tableOptionSql(canUseTableOptions.check("ck_name", "check_rule"), true))
        verifyEq("ADD CONSTRAINT fk_name FOREIGN KEY (column_name_1, column_name_2) REFERENCES referenced_table_name (referenced_column_name_1, referenced_column_name_2)", adapter.tableOptionSql(canUseTableOptions.foreignKey("fk_name", ["column_name_1", "column_name_2"], canUseTableOptions.references("referenced_table_name", ["referenced_column_name_1", "referenced_column_name_2"])), true))
        verifyEq("ADD INDEX idx_name (column_name_1, column_name_2)", adapter.tableOptionSql(canUseTableOptions.index("idx_name", ["column_name_1", "column_name_2"]), true))
        verifyEq("ADD CONSTRAINT pk_name PRIMARY KEY (column_name_1, column_name_2)", adapter.tableOptionSql(canUseTableOptions.primaryKey("pk_name", ["column_name_1", "column_name_2"]), true))
        verifyEq("ADD CONSTRAINT uq_name UNIQUE (column_name_1, column_name_2)", adapter.tableOptionSql(canUseTableOptions.unique("uq_name", ["column_name_1", "column_name_2"]), true))
        verifyErr(Err#) {
            adapter.tableOptionSql(GenericTableOptionTestClass())
        }
        verifyErr(Err#) {
            adapter.tableOptionSql(GenericTableOptionTestClass(), true)
        }
    }

    **
    ** Tests `GenericAdapter.dropTableOptionsSql`.
    **
    Void testDropTableOptionSql() {
        verifyEq("DROP FOREIGN KEY fk_name", adapter.dropTableOptionSql(DroppedForeignKeyTableOption("fk_name")))
        verifyEq("DROP INDEX idx_name", adapter.dropTableOptionSql(DroppedIndexTableOption("idx_name")))
        verifyEq("DROP PRIMARY KEY pk_name", adapter.dropTableOptionSql(DroppedPrimaryKeyTableOption("pk_name")))
    }

    **
    ** Tests `GenericAdapter.createColumnSql`
    **
    Void testCreateColumnSql() {
        verifyEq("column_name BLOB", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob)))
        verifyEq("ADD COLUMN column_name BLOB", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob), true))
        verifyEq("column_name BLOB AUTO_INCREMENT", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob) { autoIncrement }))
        verifyEq("column_name BLOB CHECK (check_rule)", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob) { check("check_rule") }))
        verifyEq("column_name BLOB COMMENT 'comment'", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob) { comment("comment") }))
        verifyEq("column_name BLOB DEFAULT default_value", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob) { defaultValue("default_value") }))
        verifyEq("column_name BLOB NOT NULL", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob) { notNull }))
        verifyEq("column_name BLOB PRIMARY KEY", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob) { primaryKey }))
        verifyEq("column_name BLOB REFERENCES referenced_table_name (referenced_column_name)", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob) { references("referenced_table_name", "referenced_column_name") }))
        verifyEq("column_name BLOB UNIQUE", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob) { unique }))
        verifyEq("column_name BLOB AUTO_INCREMENT CHECK (check_rule) COMMENT 'comment'", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob) { autoIncrement; check("check_rule"); comment("comment") }))
        verifyEq("column_name BLOB DEFAULT default_value NOT NULL", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob) { defaultValue("default_value"); notNull }))
        verifyEq("column_name BLOB PRIMARY KEY REFERENCES referenced_table_name (referenced_column_name)", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob) { primaryKey; references("referenced_table_name", "referenced_column_name") }))
        verifyEq("ADD COLUMN column_name BLOB PRIMARY KEY UNIQUE", adapter.createColumnSql(canCreateColumn.createColumn("column_name", canCreateColumn.blob) { primaryKey; unique }, true))
    }

    Void testDropColumnSql() {
        verifyEq("DROP COLUMN column_name", adapter.dropColumnSql(canDropColumn.dropColumn("column_name")))
    }

    **
    ** Tests `GenericAdapter.columnDefinition`
    **
    Void testColumnDefinition() {
        verifyEq("BLOB", adapter.columnDefinition(canUseColumnType.blob))
        verifyEq("CHAR", adapter.columnDefinition(canUseColumnType.char))
        verifyEq("CHAR(1234)", adapter.columnDefinition(canUseColumnType.char(1234)))
        verifyEq("DATE", adapter.columnDefinition(canUseColumnType.date))
        verifyEq("DECIMAL", adapter.columnDefinition(canUseColumnType.decimal))
        verifyEq("DECIMAL(1234)", adapter.columnDefinition(canUseColumnType.decimal(1234)))
        verifyEq("DECIMAL(1234, 5678)", adapter.columnDefinition(canUseColumnType.decimal(1234, 5678)))
        verifyEq("DOUBLE", adapter.columnDefinition(canUseColumnType.double))
        verifyEq("DOUBLE(1234)", adapter.columnDefinition(canUseColumnType.double(1234)))
        verifyEq("DOUBLE(1234, 5678)", adapter.columnDefinition(canUseColumnType.double(1234, 5678)))
        verifyEq("FLOAT", adapter.columnDefinition(canUseColumnType.float))
        verifyEq("FLOAT(1234)", adapter.columnDefinition(canUseColumnType.float(1234)))
        verifyEq("FLOAT(1234, 5678)", adapter.columnDefinition(canUseColumnType.float(1234, 5678)))
        verifyEq("INTEGER", adapter.columnDefinition(canUseColumnType.integer))
        verifyEq("INTEGER(1234)", adapter.columnDefinition(canUseColumnType.integer(1234)))
        verifyEq("TEXT", adapter.columnDefinition(canUseColumnType.text))
        verifyEq("TIMESTAMP", adapter.columnDefinition(canUseColumnType.timestamp))
        verifyEq("VARCHAR", adapter.columnDefinition(canUseColumnType.varchar))
        verifyEq("VARCHAR(1234)", adapter.columnDefinition(canUseColumnType.varchar(1234)))
    }

    **
    ** Tests `GenericAdapter.autoIncrementColumnOptionSql`
    **
    Void testAutoIncrementColumnOptionSql() {
        option := canUseColumnOptions.autoIncrement
        expected := "AUTO_INCREMENT"
        verifyEq(expected, adapter.autoIncrementColumnOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.checkColumnOptionSql`
    **
    Void testCheckColumnOptionSql() {
        option := canUseColumnOptions.check("check_rule")
        expected := "CHECK (check_rule)"
        verifyEq(expected, adapter.checkColumnOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.commentColumnOptionSql`
    **
    Void testCommentColumnOptionSql() {
        option := canUseColumnOptions.comment("comment")
        expected := "COMMENT 'comment'"
        verifyEq(expected, adapter.commentColumnOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.defaultValueColumnOptionSql`
    **
    Void testDefaultValueColumnOptionSql() {
        option := canUseColumnOptions.defaultValue("default_value")
        expected := "DEFAULT default_value"
        verifyEq(expected, adapter.defaultValueColumnOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.notNullColumnOptionSql`
    **
    Void testNotNullColumnOptionSql() {
        option := canUseColumnOptions.notNull
        expected := "NOT NULL"
        verifyEq(expected, adapter.notNullColumnOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.primaryKeyColumnOptionSql`
    **
    Void testPrimaryKeyColumnOptionSql() {
        option := canUseColumnOptions.primaryKey
        expected := "PRIMARY KEY"
        verifyEq(expected, adapter.primaryKeyColumnOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.referencesColumnOptionSql`
    **
    Void testReferencesColumnOptionSql() {
        option := canUseColumnOptions.references("table_name", "column_name")
        expected := "REFERENCES table_name (column_name)"
        verifyEq(expected, adapter.referencesColumnOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.uniqueColumnOptionSql`
    **
    Void testUniqueColumnOptionSql() {
        option := canUseColumnOptions.unique
        expected := "UNIQUE"
        verifyEq(expected, adapter.uniqueColumnOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.checkTableOptionSql`
    **
    Void testCheckTableOptionSql() {
        option := canUseTableOptions.check("ck_name", "check_rule")
        expected := "CONSTRAINT ck_name CHECK (check_rule)"
        verifyEq(expected, adapter.checkTableOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.foreignKeyTableOptionSql`
    **
    Void testForeignKeyTableOptionSql() {
        option := canUseTableOptions.foreignKey("fk_name", ["column_name_1", "column_name_2"], canUseTableOptions.references("referenced_table_name", ["referenced_column_name_1", "referenced_column_name_2"]))
        expected := "CONSTRAINT fk_name FOREIGN KEY (column_name_1, column_name_2) REFERENCES referenced_table_name (referenced_column_name_1, referenced_column_name_2)"
        verifyEq(expected, adapter.foreignKeyTableOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.indexTableOptionSql`
    **
    Void testIndexTableOptionSql() {
        option := canUseTableOptions.index("idx_name", ["column_name_1", "column_name_2"])
        expected := "INDEX idx_name (column_name_1, column_name_2)"
        verifyEq(expected, adapter.indexTableOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.primaryKeyTableOptionSql`
    **
    Void testPrimaryKeyTableOptionSql() {
        option := canUseTableOptions.primaryKey("pk_name", ["column_name_1", "column_name_2"])
        expected := "CONSTRAINT pk_name PRIMARY KEY (column_name_1, column_name_2)"
        verifyEq(expected, adapter.primaryKeyTableOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.uniqueTableOptionSql`
    **
    Void testUniqueTableOptionSql() {
        option := canUseTableOptions.unique("uq_name", ["column_name_1", "column_name_2"])
        expected := "CONSTRAINT uq_name UNIQUE (column_name_1, column_name_2)"
        verifyEq(expected, adapter.uniqueTableOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.dropForeignKeyTableOption`
    **
    Void testDropForeignKeyTableOption() {
        option := canDropTableOptions.dropForeignKey("fk_name")
        expected := "DROP FOREIGN KEY fk_name"
        verifyEq(expected, adapter.dropForeignKeyTableOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.dropIndexTableOption`
    **
    Void testDropIndexTableOption() {
        option := canDropTableOptions.dropIndex("idx_name")
        expected := "DROP INDEX idx_name"
        verifyEq(expected, adapter.dropIndexTableOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.dropPrimaryKeyTableOption`
    **
    Void testDropPrimaryKeyTableOption() {
        option := canDropTableOptions.dropPrimaryKey("pk_name")
        expected := "DROP PRIMARY KEY pk_name"
        verifyEq(expected, adapter.dropPrimaryKeyTableOptionSql(option))
    }

    **
    ** Tests `GenericAdapter.dropTableSql`
    **
    Void testDropTableSql() {
        table := DroppedTable("table_name")
        expected := "DROP TABLE table_name"
        verifyEq(expected, adapter.dropTableSql(table))
    }

    **
    ** Tests `GenericAdapter.executeSql`
    **
    Void testExecuteSql() {
        sql := ExecutedSql("SELECT * FROM table")
        expected := "SELECT * FROM table"
        verifyEq(expected, adapter.executeSql(sql))
    }

    **
    ** Tests `GenericAdapter.logMigrationSql`
    **
    Void testLogMigrationSql() {
        expected := "INSERT INTO version_history (vh_from_version, vh_to_version) VALUES (@from, @to)"
        verifyEq(expected, adapter.logMigrationSql)
    }

    **
    ** Tests `GenericAdapter.dbVersionSql`
    **
    Void testDbVersionSql() {
        expected := "SELECT vh_to_version FROM version_history WHERE vh_id = (SELECT MAX(vh_id) FROM version_history)"
        verifyEq(expected, adapter.dbVersionSql)
    }

    **
    ** Tests `GenericAdapter.sql`.
    **
    Void testMigrationZero() {
        migrationZero := MigrationZero()
        migrationZero.up
        verifyEq(1, migrationZero.modifications.size)
        expected := """CREATE TABLE version_history (
                       vh_id INTEGER AUTO_INCREMENT COMMENT 'The ID of the migration' PRIMARY KEY,
                       vh_timestamp TIMESTAMP COMMENT 'The timestamp of the migration' DEFAULT NOW() NOT NULL,
                       vh_from_version VARCHAR(32) COMMENT 'The version being migrated from' NOT NULL,
                       vh_to_version VARCHAR(32) COMMENT 'The version being migrated to' NOT NULL
                       )"""
        verifyEq(expected, adapter.sql(migrationZero.modifications[0]))
    }

}

**
** Provides a simple (unknown) implementation of `TableOption` for testing.
**
class GenericTableOptionTestClass : TableOption {

    **
    ** Creates a new `GenericTableOptionTestClass`.
    **
    new make() : super("fake") {
    }

}